
import UIKit


extension UIResponder {
    private weak static var tf_currentFirstResponder: UIResponder? = nil

    //类方法
    static func tf_firstResponder() -> AnyObject? {
        UIResponder.tf_currentFirstResponder = nil
        UIApplication.shared.sendAction(#selector(tf_findFirstResponder(_:)), to: nil, from: nil, for: nil)
        return UIResponder.tf_currentFirstResponder
    }
    
    @objc func tf_findFirstResponder(_ sender: AnyObject) {
//        tf_currentFirstResponder = self
        UIResponder.tf_currentFirstResponder = self

    }
}
